<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: install.php 8889 2010-04-23 07:48:22Z monkey $
 */
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$sql = <<<EOF

DROP TABLE IF EXISTS pre_er_filedset;
create table pre_er_filedset
(
    id          int auto_increment
        primary key,
    uid         int                                           not null,
    title       varchar(100)                   null comment '文件标题',
    url        varchar(255)                   null comment '链接',
    sort        int                         default 1         null comment '排序',
    status      tinyint(3)                  default 3         null comment '1正常、2异常',
    create_time int                                           null comment '创建时间',
    update_time int                                           null comment '更新时间'
)
    engine = InnoDB;
    
DROP TABLE IF EXISTS pre_er_filedset_config;
create table pre_er_filedset_config
(
    id     int auto_increment
        primary key,
    `key`  varchar(50)  null,
    name   varchar(50)  null,
    value  text         null,
    `desc` varchar(255) null,
    constraint pre_er_filedset_config_pk
        unique (`key`)
)
    engine = InnoDB;

EOF;

runquery($sql);

$insert_sql = <<<EOF
INSERT INTO `pre_er_filedset_config` (`key`, name, value, `desc`) 
VALUES 
('path_before', '列表链接前缀', '["",""]', '为空时默认当前域名。<br><a href="https://bbs.20cms.com/thread-9-1-1.html" target="_blank">跨域名内容访问代理配置教程：Nginx与Apache实现方法</a>'),
('allowed_groups', '允许上传的用户组', 'a:9:{i:0;s:1:"9";i:1;s:2:"10";i:2;s:2:"11";i:3;s:2:"12";i:4;s:2:"13";i:5;s:2:"14";i:6;s:2:"15";i:7;s:1:"1";i:8;s:1:"7";}', ''),
('position', '电脑端导航按钮展示位置', 'global_nav_extra', ''),
('max_size', '单个上传文件大小', '10', '上传文件的最大大小，单位：字节（默认单位KB）'),
('file_types', '允许的文件类型', 'txt', '允许上传的文件类型，多个类型用英文逗号分隔'),
('file_num','用户总文件数量限制','10','用户总文件数量限制');
EOF;

runquery($insert_sql);

$finish = TRUE;

?>